package com.redog.service;

import com.redog.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service

public class UserService {

    @Autowired
    UserDao userDao;

    /**
     * 转账的业务逻辑
     */
    @Transactional
     public  void accountMoney(){
         //lucy少100
         userDao.reduceMoney();

         //出现意外停止了
         int a =10/0;


         //mary多100
         userDao.addMoney();
     }
}
